package com.inray.nbs.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.inray.nbs.bean.Vehicle_bat_single_temp;
import com.inray.nbs.bean.Vehicle_bat_single_vol;
import com.inray.nbs.bean.Vehicle_data;
import com.inray.nbs.bean.Vehicle_gps_data;
import com.inray.nbs.bean.Vehicle_info;
import com.inray.nbs.bean.Vehicle_location;
import com.inray.nbs.bean.Vehicle_warning_data;
import com.inray.nbs.dao.BaseDao;
import com.inray.nbs.service.VehicleService;

@Service
public class VehicleServiceImpl implements VehicleService{
	@Resource(name="baseDaoImpl")
	protected BaseDao baseDao;
	
	@Override
	public List<Vehicle_gps_data> selectGpsByOne(Map<String,Object> map){
		return baseDao.selectListBySqlId("Vehicle_gps_data.selectGpsByOne", map);
	}
	//根据用户ID查询车辆省市位置信息
	@Override
	public List<Vehicle_location> selectVehicleLocationByUser(Map<String,Object> map){
		return baseDao.selectListBySqlId("Vehicle_location.selectVehicleLocationByUser", map);
	}
	//根据用户ID查询各省车辆数量
	@Override
	public List<Vehicle_location> selectLocationVehicleByUser_province(Map<String,Object> map){
		return baseDao.selectListBySqlId("Vehicle_location.selectLocationVehicleByUser_province", map);
	}
	//根据用户ID查询各市车辆数量
	@Override
	public List<Vehicle_location> selectLocationVehicleByUser_city(Map<String,Object> map){
		return baseDao.selectListBySqlId("Vehicle_location.selectLocationVehicleByUser_city", map);
	}
	//根据车辆ID查询车辆实时数据
	@Override
	public Vehicle_info selectAllByOne(Map<String,Object> map){
		return (Vehicle_info) baseDao.selectOneBySqlId("Vehicle_info.selectAllByOne", map);
	}
	//根据用户ID查询车辆报警信息
	@Override
	public List<Vehicle_warning_data> selectVehicleIsAlert(Map<String,Object> map){
		return baseDao.selectListBySqlId("Vehicle_warning_data.selectVehicleIsAlert", map);
	}
	//更新车辆省市位置信息
	@Override
	public int updateVehicleLocation(List<Vehicle_location> vl){
		int i=1;
		for(Vehicle_location v:vl){
			i=baseDao.insert(v);
		}
		return i;
	}
	//根据用户id查询车辆状态
	@Override
	public List<Vehicle_data> selectVehicleStatusByUser(Map<String,Object> map){
		return baseDao.selectListBySqlId("Vehicle_data.selectVehicleStatusByUser", map);
	}
	//根据车辆ID查询电池单体电压
	@Override
	public List<Vehicle_bat_single_vol> selectBatVolByOne(Map<String, Object> map){
		return baseDao.selectListBySqlId("Vehicle_bat_single_vol.selectBatVolByOne", map);
	}
	//根据车辆ID查询电池探针温度
	@Override
	public List<Vehicle_bat_single_temp> selectBatTempByOne(Map<String, Object> map) {
		return baseDao.selectListBySqlId("Vehicle_bat_single_temp.selectBatTempByOne", map);
	}
	@Override
	public List<Vehicle_gps_data> selectPlayBackByOne(Map<String,Object> map){
		return baseDao.selectListBySqlId("History_info.selectPlayBackByOne", map);
	}
//	@Override
//	public Vehicle_info selectChargerByOne(Map<String,Object> map){
//		return (Vehicle_info) baseDao.selectOneBySqlId("Real_time_voltage_info.selectChargerByOne", map);
//	}
//	@Override
//	public Vehicle_info selectByOne(Map<String,Object> map){
//		return (Vehicle_info) baseDao.selectOneBySqlId("Vehicle_info.selectByOne", map);
//	}
//	@Override
//	public Vehicle_info selectDriveByOne(Map<String,Object> map){
//		return (Vehicle_info) baseDao.selectOneBySqlId("Real_time_motor_info.selectDriveByOne", map);
//	}
//	@Override
//	public Vehicle_info selectEpsByOne(Map<String,Object> map){
//		return (Vehicle_info) baseDao.selectOneBySqlId("Real_time_motor_info.selectEpsByOne", map);
//	}
//	
//	@Override
//	public  Vehicle_info selectBatByOne(Map<String,Object> map){
//		return (Vehicle_info) baseDao.selectOneBySqlId("Real_time_bat_info.selectBatByOne", map) ;
//	}

//	@Override
//	public List<Vehicle_state> selectVehicleAnalysisData(Map<String,Object> map){
//		return baseDao.selectListBySqlId("Vehicle_state.selectVehicleAnalysisData", map);
//	}
//	@Override
//	public List<Vehicle_info> selectAlarmAnalysis(Map<String,Object> map){
//		return baseDao.selectListBySqlId("History_info.selectAlarmAnalysis", map);
//	}
//	@Override
//	public List<Vehicle_info> selectParameterAnalysis(Map<String,Object> map){
//		return baseDao.selectListBySqlId("History_info.selectParameterAnalysis", map);
//	}
//	@Override
//	public List<Vehicle_info> HistoryInfoExportExcel(Map<String,Object> map){
//		return baseDao.selectListBySqlId("History_info.HistoryInfoExportExcel", map);
//	}
//	@Override
//	public List<Vehicle_info> selectAlertDetailData(Map<String,Object> map){
//		return baseDao.selectListBySqlId("History_info.selectAlertDetailData", map);
//	}
//	@Override
//	public List<Vehicle_info> selectVehicleAllDataInfo(Map<String,Object> map){
//		return baseDao.selectListBySqlId("History_info.selectVehicleAllDataInfo", map);
//	}
//	@Override
//	public List<Integer> selectVehicleAllDataCount(Map<String,Object> map){
//		return baseDao.selectListBySqlId("History_info.selectVehicleAllDataCount", map);
//	}
//	@Override
//	public Vehicle_info selectVehicleInfoByOne(int id){
//		return (Vehicle_info) baseDao.selectOneById(Vehicle_info.class, id);
//	}
//	@Override
//	public List<Vehicle_info> selectMileageAnalysis(Map<String, Object> map) {
//		// TODO Auto-generated method stub
//		return baseDao.selectListBySqlId("History_info.selectMileageAnalysis", map);
//	}
}
